package items.containers;

import items.Item;
import items.ItemType;
import items.SlotType;
import items.consumables.Bacon;
import items.weapons.Twona;

import java.util.ArrayList;
import java.util.List;

public class KitchenFridge implements Container{
    private static Item me;
    private boolean openBool = false;
    private List<Item> contents = new ArrayList<Item>();

    public static synchronized Item getInstance() {
        if (me == null) {
            me = new KitchenFridge();
        }
        return me;
    }



    public KitchenFridge() {
        contents.add(Twona.getInstance());
        contents.add(Bacon.getInstance());
    }

    @Override
    public String getTitle() {
        return "Kitchen Refrigerator";
    }

    @Override
    public String getDescription() {
        return "It's just a fridge on the outside.  But inside, it's disgusting.";
    }

    @Override
    public String getShortName() {
        return "Fridge";
    }

    @Override
    public ItemType getItemType() {
        return ItemType.CONTAINER;
    }

    @Override
    public SlotType getSlotType() {
        return null;
    }

    @Override
    public String getDisplayName() {
        return getTitle() + "(" + getShortName() + ")";
    }

    @Override
    public int getAwesomenessModifier() {
        return 0;
    }

    @Override
    public int getHaxxorsModifier() {
        return 0;
    }

    @Override
    public int getMasteryModifier() {
        return 0;
    }

    @Override
    public int getConfuciusModifier() {
        return 0;
    }

    @Override
    public boolean isOpen() {
        return openBool;
    }

    @Override
    public void openContainer() {
        openBool = true;
    }

    @Override
    public void closeContainer() {
        openBool = false;
    }

    @Override
    public List<Item> getContents() {
        return contents;
    }

    @Override
    public String showContents() {
        StringBuilder buf = new StringBuilder();
        for (Item item : getContents()) {
            buf.append("\n");
            buf.append(item.getTitle());
        }
        return buf.toString();
    }
}